﻿if (typeof Axis == "undefined") Axis = {};
if (typeof Axis.Admin == "undefined") Axis.Admin = {};
Axis.Admin.Home = {
    Init: function () {
        this.GetAdminCategory();
    },
    GetAdminCategory: function () {
        var data = {
            Action: "GetAdminCategory",
            FunctionCode: "AdminCategory",
            Context: "GroupUser"
        };
        $.Ajax({
            url: '../../Views/Accounts/Service/UserService.ashx',
            type: 'POST',
            data: data,
            success: function (data, textStatus, jqXHR) {
                if (data) {
                    data = eval("(" + data + ")");
                    var ret_parent = "";
                    
                    $.each(data, function (index, item) {
                        console.log(item.Code + "-" + item.Name);
                        $(".Panel-Controls").find("a[code='" + item.Code + "']").parent().show();
                    });

                }
            },
            beforeSend: function (jqXHR, settings) {
            },
            error: function (jqXHR, textStatus, errorThrown) {
            },
            complete: function (XMLHttpRequest, textStatus) {
            }
        });
    }
};
$(function () {
    Axis.Admin.Home.Init();
});